﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="googleStockList.aspx.cs"
    Inherits="Manage_googleStockList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Google股市資料下載</title>
    <script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.validate.js" type="text/javascript"></script>
    <script src="../Scripts/stringbuilder.js" type="text/javascript"></script>
    <%--<script src="../Scripts/wudada.core.js" type="text/javascript"></script>--%>
    <%--<script src="script/googleStockList.aspx.js" type="text/javascript"></script>--%>
    <script type="text/javascript">
//        gGoogleStockList.pingTarget = "<%=pingTarget %>";
//        gGoogleStockList.period = "<%=period %>";
//        gGoogleStockList.pageNum = parseInt("<%=pageNum %>");
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div>
                起始日期：
                <asp:DropDownList ID="ddlStartYear" runat="server">
                </asp:DropDownList>
                年
                <asp:DropDownList ID="ddlStartMonth" runat="server">
                    <asp:ListItem Text="1" Value="Jan"></asp:ListItem>
                    <asp:ListItem Text="2" Value="Feb"></asp:ListItem>
                    <asp:ListItem Text="3" Value="Mar"></asp:ListItem>
                    <asp:ListItem Text="4" Value="Apr"></asp:ListItem>
                    <asp:ListItem Text="5" Value="May"></asp:ListItem>
                    <asp:ListItem Text="6" Value="Jun"></asp:ListItem>
                    <asp:ListItem Text="7" Value="Jul"></asp:ListItem>
                    <asp:ListItem Text="8" Value="Aug"></asp:ListItem>
                    <asp:ListItem Text="9" Value="Sep"></asp:ListItem>
                    <asp:ListItem Text="10" Value="Oct"></asp:ListItem>
                    <asp:ListItem Text="11" Value="Nov"></asp:ListItem>
                    <asp:ListItem Text="12" Value="Dec"></asp:ListItem>
                </asp:DropDownList>
                月
                <asp:DropDownList ID="ddlStartDay" runat="server">
                </asp:DropDownList>
                日&nbsp;&nbsp;&nbsp;&nbsp; 結束日期：
                <asp:DropDownList ID="ddlEndYear" runat="server">
                </asp:DropDownList>
                年
                <asp:DropDownList ID="ddlEndMonth" runat="server">
                    <asp:ListItem Text="1" Value="Jan"></asp:ListItem>
                    <asp:ListItem Text="2" Value="Feb"></asp:ListItem>
                    <asp:ListItem Text="3" Value="Mar"></asp:ListItem>
                    <asp:ListItem Text="4" Value="Apr"></asp:ListItem>
                    <asp:ListItem Text="5" Value="May"></asp:ListItem>
                    <asp:ListItem Text="6" Value="Jun"></asp:ListItem>
                    <asp:ListItem Text="7" Value="Jul"></asp:ListItem>
                    <asp:ListItem Text="8" Value="Aug"></asp:ListItem>
                    <asp:ListItem Text="9" Value="Sep"></asp:ListItem>
                    <asp:ListItem Text="10" Value="Oct"></asp:ListItem>
                    <asp:ListItem Text="11" Value="Nov"></asp:ListItem>
                    <asp:ListItem Text="12" Value="Dec"></asp:ListItem>
                </asp:DropDownList>
                月
                <asp:DropDownList ID="ddlEndDay" runat="server">
                </asp:DropDownList>
                日
                <br />
                清單全部下載：<asp:Button ID="btnDownLoadAll" runat="server" Text="下載" OnClick="btnDownLoadAll_Click" />
                清單全部產生csv：<asp:Button ID="btnGenFileAll" runat="server" Text="產生csv" 
                    onclick="btnGenFileAll_Click" />
                <br />
            </div>
            <div>
                股票清單維護
                <br />
                名稱：<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="請輸入名稱"
                    ControlToValidate="txtName" ValidationGroup="Add"></asp:RequiredFieldValidator>
                代碼：
                <asp:DropDownList ID="ddlCode" runat="server">
                    <asp:ListItem Text="TPE:"></asp:ListItem>
                </asp:DropDownList>
                <asp:TextBox ID="txtStockCode" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="請輸入代碼"
                    ControlToValidate="txtStockCode" ValidationGroup="Add"></asp:RequiredFieldValidator>
                <asp:Button ID="btnAdd" runat="server" Text="建立" OnClick="btnAdd_Click" ValidationGroup="Add" />
                <br />
                <br />
                <asp:GridView ID="gvList" runat="server" BackColor="White" BorderColor="#DEDFDE"
                    AutoGenerateColumns="false" BorderStyle="None" BorderWidth="1px" CellPadding="4"
                    ForeColor="Black" GridLines="Vertical" Width="100%" CssClass="datagrid" OnRowCommand="gvList_RowCommand"
                    OnRowDataBound="gvList_RowDataBound">
                    <RowStyle BackColor="#F7F7DE" />
                    <FooterStyle BackColor="#CCCC99" />
                    <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                    <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        <asp:TemplateField HeaderText="No.">
                            <ItemTemplate>
                                <%# Container.DataItemIndex + 1 %></ItemTemplate>
                            <ItemStyle Width="5%" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="名稱">
                            <ItemTemplate>
                                <asp:Label ID="lblName" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Left" Width="25%" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="代碼">
                            <ItemTemplate>
                                <asp:Label ID="lblValue" runat="server" Text='<%# Bind("Value") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Left" Width="15%" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="最後資料日期">
                            <ItemTemplate>
                                <asp:Label ID="lblDataTime" runat="server"></asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Left" Width="15%" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="回補資料">
                            <ItemTemplate>
                                <asp:LinkButton ID="btnGetData" runat="server" CommandArgument='<%# Eval("ItemParamId") %>'
                                    CommandName="myGetData" CausesValidation="False" Text="回補" OnClientClick="return confirm('確認回補此股票?')" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="10%" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="產生檔案">
                            <ItemTemplate>
                                <asp:LinkButton ID="btnGenFile" runat="server" CommandArgument='<%# Eval("ItemParamId") %>'
                                    CommandName="myGenFile" CausesValidation="False" Text="產生" OnClientClick="return confirm('確認產生此股票檔案?')" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="10%" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="刪除">
                            <ItemTemplate>
                                <asp:LinkButton ID="btnDelete" runat="server" CommandArgument='<%# Eval("ItemParamId") %>'
                                    CommandName="myDel" CausesValidation="False" Text="刪除" OnClientClick="return confirm('確認刪除此股票?')" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="10%" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <div align="left">
                            無資料。</div>
                    </EmptyDataTemplate>
                </asp:GridView>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>
